package net.viralpatel.struts2;

import java.sql.ResultSet;
import java.sql.SQLException;

import javax.swing.JButton;

import com.opensymphony.xwork2.ActionSupport;

public class ViewAction extends ActionSupport{
	private String roomType;
	JDBCQuery jdbc;
	ResultSet rs;
	private String price;
	private String description;
	public String execute()
	{
		try {
			jdbc=new JDBCQuery();
			rs=jdbc.getRoom(roomType);
			while(rs.next())
			{
				setPrice(rs.getString("price"));
				setDescription(rs.getString("description"));
				
				
			}
			
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return SUCCESS;
		
	}
	public String getRoomType() {
		return roomType;
	}
	public void setRoomType(String roomType) {
		this.roomType = roomType;
	}
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	
	
}
